package com.cloudeye.im.dto;

import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;

@Data
public class ChatRecordRootDTO {

    @JSONField(name = "chat_type")
    private String chatType;

    private JSONObject payload;
    private String from;
    private String to;

    @JSONField(name = "msg_id")
    private String msgId;
    private long timestamp;
    private String direction;

    public ChatRecordRootDTO convert(String source){
         return JSONObject.parseObject(source,ChatRecordRootDTO.class);
    }
}
